using UnityEngine;
using System.Collections;

public class FireScript : MonoBehaviour {
	
	public Rigidbody fire;
	public float power = 1000;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		
		if(Input.GetKeyDown("z")){			
			Rigidbody instance = Instantiate(fire, transform.position,transform.rotation) as Rigidbody;
			Vector2 fwd = transform.TransformDirection(Vector2.right);
			instance.AddForce(fwd * power);
			Destroy(instance.gameObject, 1);
			}	
	}
	
	
}
